package org.peterf.foxish.component;

import org.peterf.foxish.buffer.IndexBuffer;
import org.peterf.foxish.buffer.VertexBuffer;
import org.peterf.foxish.camera.Camera;
import org.peterf.foxish.program.Program;

/**
 * This is the basic class for all geometries.
 * 
 * @author peter
 * 
 */
public abstract class Geometry implements Presentable {

    /**
     * Index buffer for drawing the geometry. Subclasses should set this
     * properly.
     */
    protected IndexBuffer indexBuffer = null;

    /**
     * The program for rendering. Subclasses should set this properly.
     */
    protected Program program = null;

    /**
     * Vertex buffer for drawing the geometry. Subclasses should set this
     * properly.
     */
    protected VertexBuffer vertexBuffer = null;

    /**
     * Creation time.
     */
    public abstract void onCreate();

    /**
     * Destruction time.
     */
    public abstract void onDestroy();

    /**
     * Rendering time.
     */
    public abstract void onDraw(Camera camera, float elapsed);

    /**
     * Time to recover lost context in OpenGL.
     */
    public abstract void onRecreate();

}
